#include "rectangle.h"

using namespace Shapes;

Rectangle::Rectangle(double w, double h)
{
	width = w;
	height = h;
}

double Rectangle::getWidth()
{
	return width;
}

double Rectangle::getHeight()
{
	return height;
}

double Rectangle::perimeter()
{
	return 2 * width + 2 * height;
}

double Rectangle::area()
{
	return width * height;
}

double Rectangle::diagonal()
{
	return sqrt(pow(width, 2) + pow(height, 2));
}

void Rectangle::draw(bool hollow)
{
	int row = 0, col = 0;

	while(row < height)
	{
		cout << "*";

		if(col == width - 1)
		{				
			cout << endl;
			col =0;
			row++;
		}		
		else
			col++;
	}
}

Rectangle::~Rectangle()
{
	cout<<"Rectangle Destructor called \n";
}